package com.example.thread;


import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * @author shanchong
 * @date 2021/2/26
 **/
public class Main2 {


    public static void main(String[] args) throws Exception {
        Callable<Integer> callable = new Callable<Integer>() {
            @Override
            public Integer call() throws Exception {
                return 1+2;
            }
        };
        FutureTask<Integer> futureTask = new FutureTask<>(callable);
        futureTask.run();
        Integer o = futureTask.get();
        System.out.println(o);

    }
}
